package com.codefox.util;

import java.util.List;

import org.springframework.stereotype.Component;

/**
 * 分页工具类
 * 
 * @author puma
 *
 * @param <T> 需要封装的对象类型
 */
@Component
public class PageUtil<T> {
	private int pageIndex;//当前页
	private int pageSize;//每页大小
	private int count;//总记录数
	private int pageNumber;//总页数，可以通过（总记录数/每页大小）计算出来
	List<T> list;//集合存放分页的数据

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	@Override
	public String toString() {
		return "PageUtil [pageIndex=" + pageIndex + ", pageSize=" + pageSize + ", count=" + count + ", PageNumber="
				+ pageNumber + ", list=" + list + "]";
	}
}
